/**
 * Tractus-X -  Digital Product Pass Application
 *
 * Copyright (c) 2022, 2024 BMW AG
 * Copyright (c) 2022, 2024 Henkel AG & Co. KGaA
 * Copyright (c) 2023, 2024 CGI Deutschland B.V. & Co. KG
 * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation
 *
 * See the NOTICE file(s) distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Apache License, Version 2.0 which is available at
 * https://www.apache.org/licenses/LICENSE-2.0.
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the
 * License for the specific language govern in permissions and limitations
 * under the License.
 *
 * SPDX-License-Identifier: Apache-2.0
 */

.cards-container {
  margin-bottom: 24px;
  padding: 6px !important;

  .sustainability {
    display: flex;
  }

  .card-container {
    min-height: 193px;
    position: relative;
    background-color: #fff;
    border-radius: 10px;
    border: solid 1px #dcdcdc;
    padding: 8px 16px;
    overflow: hidden;

    .charging-cycles-title {
      font-size: 12px;
      font-weight: 500;
      margin: 12px 0 5px 0;
    }

    .charging-cycles {
      position: relative;
      width: 80%;

      .bar-chart {
        position: absolute;
        background: #ececec;
        border-radius: 8px;
        width: 100%;
        height: 19px;
      }

      .chart-value {
        font-size: 12px;
        position: absolute;
        top: 20px;
      }

      .no-value {
        display: none;
      }

      .current {
        left: 0;
      }
      .max {
        right: 0;
      }
    }

    .card-title {
      font-size: 11px;
      font-weight: 500;
      color: #888888;
    }

    .card-icon {
      position: absolute;
      right: 7px;
      top: 7px;
      color: #939393;
    }

    .card-icon-green {
      color: #428c5b;
    }

    .card-label {
      font-size: 12px;
      font-weight: 500;
      padding-top: 13px;
    }

    .card-value {
      font-size: 24px;
      font-weight: 600;
      padding-bottom: 12px;
      word-wrap: break-word;
    }

    .card-second-value {
      font-size: 18px;
      font-weight: 500;
      padding-top: 2px;
      word-wrap: break-word;
    }

    .card-second-label {
      font-size: 12px;
      font-weight: 500;
      padding-top: 12px;
    }

    .card-info-icon {
      position: absolute;
      right: 0;
      bottom: 7px;
      color: #0f71cb;
    }

    .card-info-icon:hover {
      color: $catena-x-dark-blue;
      cursor: pointer;
    }

    .materials-container {
      width: 50%;

      .material-container {
        position: relative;
        width: 60px;
        height: 60px;
        background-color: #eaf1fe;
        border-radius: 10px;
        padding-top: 20px;
        margin: 0 15px 15px 0;

        .material-label {
          position: absolute;
          top: 5px;
          left: 5px;
          font-size: 12px;
          font-weight: 500;
        }
        .material-value {
          position: absolute;
          font-size: 16px;
          font-weight: 600;
          top: 20px;
          left: 50%;
          transform: translate(-50%, 0);
        }
      }
    }

    .co2-container {
      width: 45%;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      border-left: 1px solid lightgrey;
      .co2-value {
        font-weight: 600;
        font-size: 16px;
      }
      .co2-label {
        font-size: 10px;
      }
    }
  }
}

@media (max-width: 1600px) {
  .cards-container {
    .card-container {
      .materials-container {
        width: 50%;
        .material-container {
          .material-value {
            font-size: 14px;
          }
        }
      }
      .co2-container {
        width: 30%;
        padding-left: 15%;
      }
    }
  }
}

@media (max-width: 1300px) {
  .cards-container {
    .card-container {
      height: 193px;
      .materials-container {
        .material-container {
          width: 50px;
          height: 50px;
        }
      }
    }
  }
}

@media (max-width: 1125px) {
  .cards-container {
    .card-container {
      height: 193px;
      .materials-container {
        .material-container {
          width: 80%;
          height: 30px;
          margin: 2px 20px 2px 0;
          .material-value {
            position: absolute;
            font-size: 10px;
            font-weight: 600;
            top: 6px;
            left: 75%;
            transform: translate(-50%, 0);
          }
        }
      }
    }
  }
}

@media (max-width: 960px) {
  .cards-container {
    .card-container {
      height: auto;
      padding-bottom: 40px;
      .materials-container {
        width: 50%;

        .material-container {
          position: relative;
          width: 60px;
          height: 60px;
          background-color: #eaf1fe;
          border-radius: 10px;
          padding-top: 20px;
          margin: 0 15px 15px 0;

          .material-label {
            position: absolute;
            top: 5px;
            left: 5px;
            font-size: 12px;
            font-weight: 500;
          }
          .material-value {
            position: absolute;
            font-size: 18px;
            font-weight: 600;
            top: 20px;
            left: 50%;
            transform: translate(-50%, 0);
          }
        }
      }

      .co2-container {
        width: 45%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        border-left: 1px solid lightgrey;
        .co2-value {
          font-weight: 600;
          font-size: 16px;
        }
        .co2-label {
          font-size: 10px;
        }
      }
    }
  }
}
